home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / sound / resplay1.zip / RESPLAY.DOC < prev    next >
Text File  |  1991-02-09  |  9KB  |  229 lines

  1.          _ __   __   ()       _ __    _    __   _    ,     
  2.         ' )  ) /  `  /\      ' )  ) _//   /  ) ' )  /   Sound Sample Utility
  3.          /--' /--   /  )      /--'  /    /--/   /  /    Software for the IBM
  4.         /  \ (___, /__/__    /     /___ /  (_  (__/_    PCs useless speaker!
  5.                                                 //
  6.                               Version 1.00     (/       (C) Mark J Cox  1990
  7. _____________________________________________________________________________
  8.  
  9.  
  10. RESPLAY is a memory resident program designed to help high-level language
  11. programmers make the most of the PCs useless speaker.  By use of some 
  12. simple procedures, you can playback samples from within your programs
  13. and sample yourself.  Playback can either be to the PC speaker (no too
  14. bad) or to some external hardware (described later). This program is
  15. designed as a sister to the PLAY (currently PLAY400) series - this is
  16. a sound sampler program for VGA with lots of nice features - If you
  17. have not yet got a copy, try getting it from the BBS mentioned near the
  18. end of this documentation.
  19. _____________________________________________________________________________
  20.  
  21. POSSIBLE USES OF RESPLAY
  22. ------------------------
  23.  
  24.   o Arcade Games ("He's Dead Jim!" or realistic shooting noises)
  25.   o Sound Analysis (Fast Fourier Transforms/ analysing spoken words)
  26.   o Spelling Games for kids.
  27.   o Sampling your friends and making them sound silly (by changing
  28.     their speed, or by FFTs and altering their pitch!)
  29.   o The next 'Jive Bunny' single        
  30.  
  31. Features
  32. ========
  33.  
  34.   o Simple to call from any high or low level language
  35.   o Options for playing through Speaker or external hardware
  36.   o Total control over speed and length of samples.
  37.   o Samples can be as big as there is free memory
  38.   o Freeware (more on this later)
  39.  
  40. _____________________________________________________________________________
  41.  
  42. PUBLIC DOMAIN - FREEWARE
  43. ------------------------
  44.  
  45.      Please enjoy the RESPLAY program, you can give it to anyone
  46.      and use it for anything that does not include commercial gain.
  47.      
  48.      (IE you can give it away with any Freeware program you create,
  49.      but not with SHAREWARE ones - where you are asking a fee for
  50.      your program, or commercial ones)
  51.  
  52.      If you want to use RESPLAY in a Shareware or Commercial package
  53.      please contact the author who will be happy to negotiate a license!  
  54.  
  55.      The only stipulation is that the program remains unchanged and
  56.      that it is credited in your documentation (you need not include
  57.      this documentation with your program)
  58.  
  59.      Why did I make it FREEWARE (I've had a couple of offers from
  60.      software companies for this!)? Well, because I'm a student and
  61.      hate software that I have to pay for, then find it is useless or
  62.      I could have written better... Shareware is a bit better, letting
  63.      you evaluate the package - but it's still a costly business.. By
  64.      making this software totally free I hope more people will enjoy
  65.      it and use it in their programs.
  66.  
  67. ______________________________________________________________________________
  68.  
  69.             INSTRUCTIONS FOR USE
  70.             ====================
  71.  
  72. Resplay is a memory resident program.  That means that when you first
  73. run Resplay it stores a bit of itself (only 1.5k) in memory that can
  74. then be called by other programs run later.  To use the Resplay routines
  75. you simply have to load the register set with the values show below and
  76. call the interrupt 2F.  If you know what I am talking about, then you
  77. should be able to program using Resplay immediately - otherwise have
  78. a look at the example file, EXAMPLE.C.   Your programming manual
  79. for your favourite language should explain all about how to call Interrupts
  80. and set registers - you can do it in all the Borland TURBO packages and
  81. just about everything else I can think of.  When I get time I will 
  82. produce example programs in this package for C, BASIC and PASCAL from
  83. a variety of manufacturers.
  84.  
  85. The first thing to do is to load RESPLAY
  86.  
  87. C:\AMAZING\PROGRAMS>  RESPLAY
  88.  
  89. There are four main routines that you will need to call, these are 
  90. described below:
  91.  
  92. 1. Check if Installed:
  93.  
  94.        Set AX to 08201h (Installation Check)
  95.        Call Interrupt 2Fh
  96.        If AX contains 7746h then RESPLAY is installed.
  97.        otherwise RESPLAY is not installed.
  98.  
  99. 2. DeInstall:
  100.  
  101.        Set AX to 08202h (De Installation)
  102.        Call Interrupt 2Fh
  103.        IF AX contains 1000h (Sucess) then RESPLAY was deinstalled
  104.        otherwise RESPLAY was not already installed.
  105.  
  106. To sample or to play, the first thing to be done is to send
  107. some setup parameters to the SET UP routing
  108.  
  109. 3. Setup:
  110.  
  111.        Set AX to 8210h (Set Up Routine)
  112.        Set CL to 0 for PLAY mode, 1 for SAMPLE mode.
  113.        Set BL for what port/speaker to use
  114.                BL = 0 ;  Use Printer Port (LPT1)
  115.                BL = 1 ;  Use Printer Port (LPT2)
  116.                BL = 2 ;  Use Prototype board at 0300h
  117.                BL = 3 ;  Use Printer Port (Alternative LPT1)
  118.                BL = 4 ;  Use internal SPEAKER
  119.        Set BH for the sample/playback speed ( divided by 250 )
  120.        (BH = 44 for 11kHz, 45 for 11.25kHz etc)
  121.        Call Interrupt 2Fh
  122.        IF AX contains 1000h (Sucess) then all was ok and has been
  123.                                           set up
  124.        IF AX contains 2000h (Failure) then a parameter was out
  125.           of range (CL=0,1;BL=0..4;BH=20...160)
  126.        otherwise RESPLAY is not loaded.
  127.  
  128. Then when you actually want to do the sample/playing:
  129.  
  130. 4. Main:
  131.  
  132.         Set AX to 8200h (Main Bit)
  133.         Set DX to the Start Segment of the sample space
  134.         Set DI to the Start Offset of the sample space
  135.         Set CX to the High word of the length
  136.         Set BX to the Low word of the length
  137.         Call Interrupt 2Fh
  138.         If AX contains 1000h (Sucess) all went ok
  139.         IF AX contains 2000h (Failure) then you have not called
  140.                        setup first
  141.         otherwise RESPLAY is not loaded.
  142.  
  143.     (Note length is not in Segment:Offset form it is simply a
  144.          32 bit word. 0003 3456 would be 33456 hex bytes)
  145.  
  146. Example:
  147. --------
  148.  
  149. To Play back through the speaker at 11kHz the section of memory
  150. starting at 4EF0:0100 for 135000 bytes (nearly 135k) then:
  151.  
  152. (Check to see if installed)
  153. AX <- 8210 hex
  154. BL <- 4         (speaker)
  155. BH <- 44        (4 * 11kHz)
  156. CL <- 0         (play)
  157. Call Int 2F
  158. (Make sure that it returns Sucess)
  159. AX <- 8200 hex
  160. DX <- 4EF0  \__start from 4ef0:0100
  161. DI <- 0100  /
  162. CX <- 0002  \__ 135000 bytes = 00020F58 in hex
  163. BX <- 0F58  /              cx__////\\\\__bx
  164. Call Int 2F
  165.  
  166. _____________________________________________________________________________
  167.  
  168. WHATS THIS HARDWARE THEN?
  169. -------------------------
  170.  
  171.      By addition of a piece of hardware costing around 20 quid (to build) onto a
  172.      spare printer port you can sample your own sounds and replay them through
  173.      your hi-fi with really astonishing quality.  
  174.  
  175. HOW CAN I GET A CIRCUIT DIAGRAM?
  176. --------------------------------
  177.  
  178.      For a modest sum, I will send two 3.5" (Branded) High Density disks with
  179.      the latest version of PLAY and RESPLAY together with nicely printed
  180.      instructions and a copy of the circuit diagram.  To obtain this
  181.      package, send 10 pounds (sterling!) to the address at the end
  182.      of this document!  I make a little profit on each, but that will help
  183.      to cover the cost of the book I had to buy to improve my VGA routines!
  184.  
  185. HOW LONG A SAMPLE CAN I STORE?
  186. ------------------------------
  187.  
  188.      It depends on what frequency the sample is and how much memory is free -
  189.      at 16kHz (the speed I like to sample at) I get about 33 seconds into
  190.      memory with no TSRs except a Disk Cache - I have a mac sample at 11kHz
  191.      of the entire Dr. Who. theme tune;  Sorry, until I fathom how
  192.      to use Extended/Expanded memory it can't use it!
  193.  
  194. GREAT BBS
  195. ---------
  196.  
  197.      Try 'Kingdom of GREYHAWK' on Derby (0332) 756414 24hr for the latest
  198.      versions, PLAY350 the VGA interactive sampler and lots and lots of 
  199.